/*******************************************************************************
 * Copyright (c) 2011 Olexandr V. Shaposhnikov.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Olexandr V. Shaposhnikov - initial API and implementation and/or initial documentation
 *******************************************************************************/
package com.funkyroach.use.ui.wizard;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.dltk.core.DLTKCore;
import org.eclipse.dltk.core.IBuildpathEntry;
import org.eclipse.dltk.ui.wizards.ILocationGroup;
import org.eclipse.dltk.ui.wizards.IProjectWizard;
import org.eclipse.dltk.ui.wizards.ProjectCreator;

import com.funkyroach.use.plugin.USPlugin;

public class USProjectCreator extends ProjectCreator {

    public USProjectCreator(IProjectWizard owner, ILocationGroup locationGroup) {
        super(owner, locationGroup);
    }

    @Override
    public String getScriptNature() {
        return USPlugin.PLUGIN_ID;
    }

    protected IBuildpathEntry[] initBuildpath(IProgressMonitor monitor) throws CoreException {
        IPath projectPath = getProject().getFullPath();
        // configure the buildpath entries, including the default
        // InterpreterEnvironment library.
        List<IBuildpathEntry> cpEntries = new ArrayList<IBuildpathEntry>();
        IPath srcPath = projectPath.append("//Development//Src");

        // TODO
        // IPath[] inclusion = new IPath[2];
        // inclusion[0] = new Path();
        // IPath[] exclision = new IPath[0];
        // cpEntries.add(DLTKCore.newSourceEntry(srcPath, inclusion,
        // exclision));
        cpEntries.add(DLTKCore.newSourceEntry(srcPath));
        return cpEntries.toArray(new IBuildpathEntry[cpEntries.size()]);
    }

}
